<template>
  <div id="mine">
    <router-link to="/mypage"
      ><van-nav-bar title="健康方案" left-arrow fixed class="van-nav-bar"
    /></router-link>
    <div class="van-sk">
      <div class="articleItem" v-for="(item, i) in details" :key="i">
        <router-link :to="{path:'/detail',query:{did:item.did}}">
          <div class="articleItem-header">{{ item.title }}</div>
          <div class="articleItem-wrapper">
            <div class="articleImg">
              <img :src="`${item.img}`" />
            </div>
            <!-- <div class="articleDes">{{ item.article }}</div> -->
            <div class="articleDes" v-html="article"></div>
            <p>发布者：{{ item.author }}</p>
            <!-- 文章简介结束 -->
          </div>
          <!-- 文章图文信息结束 -->
        </router-link>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      details: {},
      article:'',
      did:''
    };
  },
  mounted() {
    this.axios.get("/details").then((res) => {
      console.log(res);
      this.details = res.data.result;
      // this.article = res.data.result[0].article;
    });
  },
};
</script>
<style scoped>
/* 通过外层id标识，穿透设置css */
#mine /deep/ .van-nav-bar__title,
#mine /deep/ .van-icon {
  color: white !important;
}
.van-nav-bar {
  background-color: rgba(88, 133, 185)
}
.van-sk {
  margin-top: 50px;
}
img {
  width: 100%;
}
p {
  font-size: 12px;
  color: black;
  position: absolute;
  bottom: 0px;
  right: 0;
}
.articleItem {
  padding: 10px 0;
  margin: 0 10px;
  border-bottom: 1px solid #999;
}
.articleItem-header {
  font-weight: 600;
  font-size: 16px;
  color: #1a1a1a;
  line-height: 22px;
}
.articleItem-wrapper {
  display: flex;
  align-items: center;
  padding-top: 10px;
  width: 100%;
  position: relative;
}
.articleImg {
  margin-right: 15px;
}
.articleImg img {
  width: 112px;
  height: 74px;
  border-radius: 5px;
}
.articleDes {
  height: 65px;
  font-size: 12px;
  overflow: hidden;
  font-weight: 400;
  text-overflow: ellipsis;
  line-height: 20px;
  letter-spacing: normal;
  color: #444;
}
</style>